/*取消粉丝js模块
 * coded: zuoxin
 * date: 2012-4-19
 */
$(function(){
	$(".cencerns_button").live('click',function(){
		var clickArea = $(this);
		
		/*取得该“粉丝”的昵称*/
		var c_name = clickArea.prevAll(".cencerns_name").text();
		
		$.ajax({
			type: "POST",
			url: "php_ajax/del_fans.php",
			dataType: "html",
			cache: false,
			data: {name: c_name},
			success: function()	{
				refreshConcerns();
			}
		});
	});
	
	function refreshConcerns(){
		/*刷新粉丝*/
		$.ajax({
			type: "POST",
			url: "php_ajax/load_fans.php",
			dataType: "html",
			cache: false,
			success: function(data) {
				$("#cencerns_box").empty().html(data);
			}
		});
		
		/*刷新粉丝数*/
		$.ajax({
			type: "POST",
			url: "php_ajax/load_fans_num.php",
			cache: false,
			success: function(data){
				data = "粉丝(" + data + ")";
				$(".left_menu .selected a").empty().html(data);
			}
		});
	}
});